import { BaseWindow } from "../../../component/window/BaseWindow";
import { ILayer } from "../../../mvc/interfaces/ILayer";
import { Language } from "../../../../extend/language/Language";
import { ObjCreate } from "../common/ObjCreate";
import { MarryGuestRequestPanel } from "./panel/MarryGuestRequestPanel";
import { MarrySceneGuestPanel } from "./panel/MarrySceneGuestPanel";
import { MuiEvent } from "../../../../com/mui/events/MuiEvent";
import { SMarryGuestInfos } from "../../../../Message/Public/SMarryGuestInfos";
import { SWeddingApplicators } from "../../../../Message/Public/SWeddingApplicators";
import { GTabBar } from "../../../../com/mui/controls/GTabBar";
type int = number;
//class MarryManageWindow
    
    export  class MarryManageWindow extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            this._tabBarData = [{"name":"RequestList", "label": Language.getString(43624)}, {"name":"SceneGuest", "label": Language.getString(43581)}];
            this._dicPanel = new Map<any, any> /* flash.utils.Dictionary */();
            super(arg1);
            setSize(411, 411);
            title = Language.getString(43580);
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            this._tabBar = ObjCreate.createGTabBar(20, 34, this._tabBarData, 70, 26, this, this.onTabBarChange);
            this._guestRequestPanel = new MarryGuestRequestPanel();
            this._guestRequestPanel.x = 18;
            this._guestRequestPanel.y = 60;
            this.addChild(this._guestRequestPanel);
            this._sceneGuestPanel = new MarrySceneGuestPanel();
            this._sceneGuestPanel.x = 18;
            this._sceneGuestPanel.y = 60;
            this.setIndexPanel(0, this._guestRequestPanel);
            this.setIndexPanel(1, this._sceneGuestPanel);
            this._currentPanel = this._guestRequestPanel;
            return;
        }

        public setIndexPanel(arg1: int, arg2: Object /* flash.display.Sprite */): void
        {
            this._dicPanel[arg1] = arg2;
            return;
        }

        /* internal  */onTabBarChange(arg1: MuiEvent): void
        {
            var loc1=this._tabBar.selectedIndex;
            var loc2=this._dicPanel[loc1];
            if (loc2 != this._currentPanel) 
            {
                if (this._currentPanel.parent) 
                {
                    this._currentPanel.parent.removeChild(this._currentPanel);
                }
                this.addChild(loc2);
                this._currentPanel = loc2;
            }
            return;
        }

        public updateSceneGuestInfos(arg1: SMarryGuestInfos): void
        {
            this._sceneGuestPanel.updateSceneGuestInfos(arg1);
            return;
        }

        public updateApplicators(arg1: SWeddingApplicators): void
        {
            this._guestRequestPanel.updateApplicators(arg1);
            return;
        }

        /* internal */ /* var */_tabBar: GTabBar;

        /* internal */ /* var */_tabBarData: Array<any>;

        /* internal */ /* var */_guestRequestPanel: MarryGuestRequestPanel;

        /* internal */ /* var */_sceneGuestPanel: MarrySceneGuestPanel;

        /* internal */ /* var */_dicPanel: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ /* var */_currentPanel: Object /* flash.display.Sprite */;
    }
